package com.example.cs4.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class MessageQueueService {

    @Autowired
    private StringRedisTemplate redisTemplate;

    private static final String CHANNEL_NAME = "chat_messages";

    public void sendMessage(String message) {
        redisTemplate.convertAndSend(CHANNEL_NAME, message);
    }

}